//
//  CoreHeader.h
//  DECXInStore
//
//  Created by 程强 on 15/12/9.
//  Copyright © 2015年 程强. All rights reserved.
//

#ifndef CoreHeader_h
#define CoreHeader_h


#define MESSAGE_NoNetwork @"网络异常，加载失败"
#define AppVersion @"1.0"
#define weak_Self(id) __weak typeof(id) weakSelf = id
// 屏幕尺寸
#define ScreenWidth      [[UIScreen mainScreen]bounds].size.width
#define ScreenHeight      [[UIScreen mainScreen]bounds].size.height

#define     IS_IPHONEX              ([UIScreen mainScreen].bounds.size.width == 375.0f && [UIScreen mainScreen].bounds.size.height == 812.0f)

#pragma mark - # 常用控件高度
#define     STATUSBAR_HEIGHT            (IS_IPHONEX ? 44.0f : 20.0f)
#define     TABBAR_HEIGHT               (IS_IPHONEX ? 49.0f + 34.0f : 49.0f)
#define     NAVBAR_HEIGHT               44.0f

#define StoryBoardViewController(sbName,sbID)   [[UIStoryboard storyboardWithName:sbName bundle:[NSBundle mainBundle]]instantiateViewControllerWithIdentifier:sbID];

#define RGBColor(r,g,b)  [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]
#define LoadImage(file) [UIImage imageNamed:file]

#define ValidString(str) [NOValidateHelper validateString:str]


#define ToastShow(view,msg)      JJRToast *toast = [[JJRToast alloc]initWithFrame:CGRectMake(0, ScreenHeight-30, ScreenWidth, 30) Message:msg superV:view]; toast.alpha = 0; [view addSubview:toast];[view bringSubviewToFront:toast];  \
[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ \
toast.alpha = 1; \
} completion:^(BOOL finished) { \
}];
//#define ToastShowInWindow(msg)   ToastShow([UIApplication sharedApplication].keyWindow,msg)

#define ToastShowInWindow(msg)   UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示" message:msg delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];[alert show];

#define PositiveFloatRegex  @"^[0-9]+([.]{1}[0-9]+){0,1}$"



#endif /* CoreHeader_h */
